#! /bin/bash -
# auto setup ppptp on ubuntu
LC_ALL=C
# BEGIN Tool Functions
. $(dirname $0)/pffs
# END Tool Functions
addSudoUser(){
	local sshBannerTemplateFileName="etc.issue.ssh";
	local sshBannerFileDir="/etc/issue.ssh";
	local userName="";
	ifYesDo "apt-get update; apt-get install sudo;" "" "make sure sudo is installed." "Sudo (su \"do\") allows a system administrator to delegate authority to give certain users (or groups of users) the ability to run some (or all) commands as root or another user while providing an audit trail of the commands and their arguments.Sudo is free software, distributed under an ISC-style license. "; # make sure sudo is installed.;
	ifYesDo "echo -n \"user name:\"; while read userName; do if [ ! \"\${userName}\" == \"\" ]; then adduser \${userName}; break; else echo -n \"User name can not be empty. New user name:\"; fi; done;" "" "add user." "It's recommended not use root to login directly for safety reason."; # add user.;
	ifYesDo "usermod -aG sudo \${userName}; groups \${userName};" "" "add user to sudo group" "So you can execut commands as a system administrator."; # add user to sudo group.;
}
addSudoUser;
